<?php


namespace app\api\controller\v1;

use app\api\model\Category as CategryModel;
use app\lib\exception\CategoryException;

class Category
{
    public function getAllCategories()
    {
        $categories = CategryModel::with('img')->select();
        if (!$categories) {
            throw new CategoryException();
        }
        return $categories;
    }
}